<?php
    echo $this->Html->script('nav/switchNavigation');
?>  
    <h2> Mes vidéos </h2>    
    
    <div class="switchNavigation">
        <div class="navSwitch">
            
        </div>
        <div class="item" id="sn-tutorial">
            <h3 class="title"> Tutoriels </h3>
            <?php
            foreach ($videosTutorial as $video){
             $usersVideo = $video['UsersVideo'];


                ?>
                <div class="col5 left">
                    <div class="col3 left">
                        <?php echo $this->Html->image('icon_video.jpg');?>
                    </div>
                    <div class="col7 right">
                        <h3><?php echo $usersVideo['title'];?></h3>

                        <p>
                            La description de la vidéo !
                        </p>
                        <div class=""> 
                            <ul>
                                <li> <?php
                                if ($video['VideosAdvice'] != null  ){
                                    echo "Vous avez demandé conseil pour cette vidéo. <br/>";
                                    echo $this->Html->link("Modifier ce conseil", array('controller' => 'VideosAdvices', 'action' => 'edit_advice', $usersVideo['id'])).'<br/>';
                                    echo $this->Html->link("Montrer les réponses", array('controller' => 'UsersVideos', 'action' => 'view', $usersVideo['id'] ));
                                }
                                else{
                                    echo $this->Html->link("Demander conseil", array('action' => 'askAdvices', $usersVideo['id'] ));
                                }
                                ?>
                                </li>
                            </ul>
                            <ul class="navHorizontal">
                                <li><?php echo $this->Display->iconEditLink(array('controller' => 'UsersVideos','action' => 'edit_video', $usersVideo['id']));?></li>                                
                                <li> <?php echo $this->Display->iconDeleteLink(array('action' => 'delVideos', $usersVideo['id']));?></li>     
                                <li> <?php  echo $this->Display->iconMoreLink(array('controller' => 'UsersVideos','action' => 'view', $usersVideo['id']));?></li>                  
                            </ul>
                        </div>
                    </div>
                </div>
                <?php
            }
            ?>
        </div>
        <div class="item" id="sn-trick">
            <h3 class="title"> Figure unique </h3>
            <?php
            foreach ($videosTrick as $video){
             $usersVideo = $video['UsersVideo'];
                ?>
                <div class="col5 left">
                    <div class="col3 left">
                        <?php echo $this->Html->image('icon_video.jpg');?>
                    </div>
                    <div class="col7 right">
                        <h3><?php echo $usersVideo['title'];?></h3>

                        <p>
                            La description de la vidéo !
                        </p>
                        <div class=""> 
                            <ul>
                                <li> <?php
                                if ($video['VideosAdvice'] != null  ){
                                    echo "Vous avez demandé conseil pour cette vidéo. <br/>";
                                    echo $this->Html->link("Modifier ce conseil", array('controller' => 'VideosAdvices', 'action' => 'edit_advice', $usersVideo['id'])).'<br/>';
                                    echo $this->Html->link("Montrer les réponses", array('controller' => 'UsersVideos', 'action' => 'view', $usersVideo['id'] ));
                                }
                                else{
                                    echo $this->Html->link("Demander conseil", array('action' => 'askAdvices', $usersVideo['id'] ));
                                }
                                ?>
                                </li>
                            </ul>
                            <ul class="navHorizontal">
                                <li><?php echo $this->Display->iconEditLink(array('controller' => 'UsersVideos','action' => 'edit_video', $usersVideo['id']));?></li>                                
                                <li> <?php echo $this->Display->iconDeleteLink(array('action' => 'delVideos', $usersVideo['id']));?></li>     
                                <li> <?php  echo $this->Display->iconMoreLink(array('controller' => 'UsersVideos','action' => 'view', $usersVideo['id']));?></li>                  
                            </ul>
                        </div>
                    </div>
                </div>
                <?php
            }
            ?>
        </div>
        <div class="item" id="sn-editing">
            <h3 class="title" > Montage </h3>
             <?php
            foreach ($videosEditing as $video){
             $usersVideo = $video['UsersVideo'];


                ?>
                <div class="col5 left">
                    <div class="col3 left">
                        <?php echo $this->Html->image('icon_video.jpg');?>
                    </div>
                    <div class="col7 right">
                        <h3><?php echo $usersVideo['title'];?></h3>

                        <p>
                            La description de la vidéo !
                        </p>
                        <div class=""> 
                            <ul>
                                <li> <?php
                                if ($video['VideosAdvice'] != null  ){
                                    echo "Vous avez demandé conseil pour cette vidéo. <br/>";
                                    echo $this->Html->link("Modifier ce conseil", array('controller' => 'VideosAdvices', 'action' => 'edit_advice', $usersVideo['id'])).'<br/>';
                                    echo $this->Html->link("Montrer les réponses", array('controller' => 'UsersVideos', 'action' => 'view', $usersVideo['id'] ));
                                }
                                else{
                                    echo $this->Html->link("Demander conseil", array('action' => 'askAdvices', $usersVideo['id'] ));
                                }
                                ?>
                                </li>
                            </ul>
                            <ul class="navHorizontal">
                                <li><?php echo $this->Display->iconEditLink(array('controller' => 'UsersVideos','action' => 'edit_video', $usersVideo['id']));?></li>                                
                                <li> <?php echo $this->Display->iconDeleteLink(array('action' => 'delVideos', $usersVideo['id']));?></li>     
                                <li> <?php  echo $this->Display->iconMoreLink(array('controller' => 'UsersVideos','action' => 'view', $usersVideo['id']));?></li>                  
                            </ul>
                        </div>
                    </div>
                </div>
                <?php
            }
            ?>
        </div>
        <div class="item" id="sn-notpublic">
            <h3 class="title"> Non Publié </h3>
            
            
        <?php
        
        if (!empty($videosNotype)){

            foreach ($videosNotype as $video){
                $usersVideo = $video['UsersVideo'];


                ?>
                <div class="col5 left">
                    <div class="col3 left">
                        <?php echo $this->Html->image('icon_video.jpg');?>
                    </div>
                    <div class="col7 right">
                        <h3><?php echo $usersVideo['title'];?></h3>

                        <p>
                            La description de la vidéo !
                        </p>
                        <div class=""> 
                            <ul>
                                <li> <?php
                                if ($video['VideosAdvice'] != null  ){
                                    echo "Vous avez demandé conseil pour cette vidéo. <br/>";
                                    echo $this->Html->link("Modifier ce conseil", array('controller' => 'VideosAdvices', 'action' => 'edit_advice', $usersVideo['id'])).'<br/>';
                                    echo $this->Html->link("Montrer les réponses", array('controller' => 'UsersVideos', 'action' => 'view', $usersVideo['id'] ));
                                }
                                else{
                                    echo $this->Html->link("Demander conseil", array('action' => 'askAdvices', $usersVideo['id'] ));
                                }
                                ?>
                                </li>
                            </ul>
                            <ul class="navHorizontal">
                                <li><?php echo $this->Display->iconEditLink(array('controller' => 'UsersVideos','action' => 'edit_video', $usersVideo['id']));?></li>                                
                                <li> <?php echo $this->Display->iconDeleteLink(array('action' => 'delVideos', $usersVideo['id']));?></li>     
                                <li> <?php  echo $this->Display->iconMoreLink(array('controller' => 'UsersVideos','action' => 'view', $usersVideo['id']));?></li>                  
                            </ul>
                        </div>
                    </div>
                </div>
                <?php
            }
        }
        else{
            ?>
            You have no Video yet ! To upload a new Video, Go there : <?php echo $this->Html->link('Post a Video', array('action' => 'uploadVideo'));?>
        <?php
        }
        ?>
        </div>
    </div>
    


    <div class="clear">
    <?php
    ?>
    </div>